/**
 * Created by levy on 16/6/15.
 */
//levy:实在是想不到好名字。。。抢单与签收页面都要用到,rush.scss​
//需要传入text/num及本月已处理数量
var RushHeader = React.createClass({
    statics: {
        updateCount: function () {
            var $p = $('.number').eq(0),
                num = $p.text();
            $p.text(--num);
        }
    },
    getInitialState: function(){
        return {
            data: this.props.data,
        }
    },
    shouldComponentUpdate: function (nextProps) {
        this.state.data = nextProps.data;
        return true;
    },
    render:function(){
        var data = this.state.data;
        //console.log(data)
        return (
            <div className="background-green flex-box-row">
                <div className="header-title-left flex-item">
                    <p>{data.text}</p>
                    <p className="number">{data.num}</p>
                </div>
                <span className="split_span"></span>
                <div className="header-title-right flex-item">
                    <p>本月已办理</p>
                    <p className="number">{data.monthlyProcessed}</p>
                </div>
            </div>
        );
    }
});

export default RushHeader;
